<template>
	<view class="content" style="background-color: #f5f5f5;">
		<u-navbar bgColor="#f5f5f5" scrollable=false titleStyle="font-size:40rpx" :placeholder='true' title="账单明细"
			:autoBack="true">
		</u-navbar>
		<!-- 账单信息 -->
		<view class="cards">
			<view class="card" v-for="(item,index) in list" :key="index">
				<view class="top li">
					<!-- item.type==1为充值 -->
					<view>{{item.title}}{{item.type==1?'':'-'}}{{item.pay_type_text}}</view>
					<view class="fw7" :style="item.type==1?'color:#DD2131;':''">{{item.type==1?'+':'-'}}{{item.price}}</view>
				</view>
				<view class="bottom li co9 fontS28">
					<view>{{item.update_time}}</view>
					<view>余额:<text>{{item.balance}}</text> </view>
				</view>
			</view>

		</view>
	</view>
</template>



<script>
	export default {
		data() {
			return {
				list:[],
				page: 1,
				limit: '10'
			}
		},
		methods: {
			getlist() {
				console.log(123);
				this.$my.get('/index/user_balance/get_balance_log', {
					page: this.page,
					limit: this.limit
				}).then(res=>{
					if(res.code==200){
						// this.list=res.data.data
						this.list.push(...res.data.data)
					}
				})
			}
		},
		onReachBottom(){
			this.page++
			this.getlist()
			console.log('到底啦');
		},
		onLoad() {
			this.getlist()
		}
	
	}
</script>

<style lang="scss" scoped>
	.content {
		.cards {
			margin: 0 4%;
			margin-top: 10rpx;
			padding-bottom: 10rpx;
			.card {
				background-color: white;
				width: 100%;
				height: 176rpx;
				border-radius: 16rpx;
				padding: 24rpx;
				box-sizing: border-box;
				margin-bottom: 20rpx;

				.li {

					display: flex;
					justify-content: space-between;
				}

				.top {
					font-size: 32rpx;
					line-height: 66rpx;
					font-weight: 400;
				}

				.bottom {
					line-height: 42rpx;
				}
			}
		}
	}
</style>
